﻿using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using XW.Blog.Domain.Entities;

namespace XW.Blog.EntityFrameworkCore
{
    [ConnectionStringName(BlogDbProperties.ConnectionStringName)]
    public class BlogDbContext : AbpDbContext<BlogDbContext>, IBlogDbContext
    { 
        /* Add DbSet for each Aggregate Root here. Example:
         * public DbSet<Question> Questions { get; set; }
         */
        //public DbSet<Article> Articles { get; set; }
        //public DbSet<BlogUser> BlogUsers { get; set; }
        //public DbSet<Comment> Comments { get; set; }
        public BlogDbContext(DbContextOptions<BlogDbContext> options) 
            : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);

            builder.ConfigureBlog();
        }
    }
}